package com.gxuwz.com_property.business.service.Impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gxuwz.com_property.business.dto.BusinessDto;
import com.gxuwz.com_property.business.mapper.BusinessMapper;
import com.gxuwz.com_property.business.pojo.Business;
import com.gxuwz.com_property.business.service.BusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class BusinessServiceImpl implements BusinessService {

    /**
     * 注册Bean
     * */
    @Autowired
    private BusinessMapper businessMapper;

    @Override
    public boolean addBusinessInfo(Business business) {
        boolean addBollean = businessMapper.addBusinessInfo(business);
        return addBollean;
    }

    @Override
    public boolean updateBusinessInfo(Business business) {
        boolean updateBoolean = businessMapper.updateBusinessInfo(business);
        return updateBoolean;
    }

    @Override
    public Business selectBusinessBybusiness(Business business) {
        Business business1 = businessMapper.selectBusinessBybusiness(business);
        return business1;
    }

    @Override
    public IPage<BusinessDto> selectBusinessByPage(Page<BusinessDto> page, BusinessDto businessDto) {
        IPage<BusinessDto> businessDtoIPage = businessMapper.selectBusinessByPage(page, businessDto);
        return businessDtoIPage;
    }

    @Override
    public List<Business> BusinessChartMangene(BusinessDto businessDto) {
        List<Business> businesses = businessMapper.BusinessChartMangene(businessDto);
        System.out.println(businesses);
        return businesses;
    }
}
